package com.cheer.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cheer.entity.ExMatchUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * 用户表
 *
 * @author cheer
 */
@Mapper
@Repository
public interface ExMatchUserDao extends BaseMapper<ExMatchUserEntity> {

    @Update("update ex_match_user set lottery_token = lottery_token - 10 where id = #{id} and lottery_token >= 10")
    int decrLotteryToken(@Param("id") Long userId);


}
